Skip to content

Document required non-interactive theme flags - #8221

Merged
gonzaloriestra merged 1 commit into
mainfrom
gonzalo/noninteractive-flags-themes
Aug 4, 2026
Merged

Document required non-interactive theme flags#8221
gonzaloriestra merged 1 commit into
mainfrom
gonzalo/noninteractive-flags-themes

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Related: https://github.com/shop/issues-develop/issues/22928

Summary

  • Apply non-interactive flag requirements to theme selection, confirmation, naming, and live-theme safety flows.
  • Cover delete, duplicate, open, publish, pull, push, and rename commands.
  • Include alternative and conditional requirements, tests,

Testing

See #8223

gonzaloriestra commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from 115a5c4 to d5f5306 Compare July 31, 2026 11:52
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch 2 times, most recently from efdaeaa to 29024a4 Compare July 31, 2026 12:29
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from d5f5306 to 21d1095 Compare July 31, 2026 12:29
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review July 31, 2026 14:09
@gonzaloriestra
gonzaloriestra requested review from a team as code owners July 31, 2026 14:09
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from 21d1095 to 1722dd0 Compare July 31, 2026 14:15
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch from 29024a4 to bbd1f45 Compare July 31, 2026 14:15
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from 1722dd0 to 58b84a9 Compare July 31, 2026 14:19
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch from bbd1f45 to 2087d48 Compare July 31, 2026 14:19
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/theme @shopify/theme package issues labels Jul 31, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch from 2087d48 to 852f6ce Compare July 31, 2026 14:39
Comment thread packages/cli/oclif.manifest.json Outdated
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from 58b84a9 to b09db8f Compare August 3, 2026 12:24
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch from 852f6ce to 04a00c0 Compare August 3, 2026 12:24
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from b09db8f to d900837 Compare August 3, 2026 13:59
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch from 04a00c0 to c9f30e9 Compare August 3, 2026 13:59
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-themes branch from c9f30e9 to 77aa551 Compare August 4, 2026 09:06
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/noninteractive-flags-apps branch from d900837 to 4c70839 Compare August 4, 2026 09:06
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/base-command.d.ts
@@ -2,8 +2,15 @@ import { Command } from '@oclif/core';
 import { OutputFlags, Input, ParserOutput, FlagInput, OutputArgs } from '@oclif/core/parser';
 export type ArgOutput = OutputArgs<any>;
 export type FlagOutput = OutputFlags<any>;
+export interface NonTTYFlagRequirement {
+    /** At least one of these flags must be present when the requirement applies. */
+    flags: string[];
+    /** Determines whether the requirement applies to the parsed flags. */
+    when?: (flags: FlagOutput) => boolean;
+}
 declare abstract class BaseCommand extends Command {
     static baseFlags: FlagInput<{}>;
+    static nonTTYFlagRequirements(_flags: FlagOutput): NonTTYFlagRequirement[];
     static descriptionWithoutMarkdown(): string | undefined;
     static analyticsNameOverride(): string | undefined;
     static analyticsStopCommand(): string | undefined;
@@ -22,6 +29,8 @@ declare abstract class BaseCommand extends Command {
     }>;
     protected environmentsFilename(): string | undefined;
     protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
+    private failMissingNonTTYFlagRequirements;
+    private applicableNonTTYFlagRequirements;
     private resultWithEnvironment;
     /**
      * Tries to load an environment to forward to the command. If no environment
packages/cli-kit/dist/public/node/cli.d.ts
@@ -55,6 +55,19 @@ export declare const portFlag: (options?: {
     env?: string;
     hidden?: boolean;
 }) => import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
+/**
+ * Marks a flag as required when the CLI cannot prompt for a value.
+ *
+ * The flag remains optional in interactive terminals. In non-interactive environments,
+ * `BaseCommand` validates the flag automatically and the requirement is shown in `--help`.
+ * Use `BaseCommand.nonTTYFlagRequirements` for conditional or alternative requirements.
+ *
+ * @param flag - An oclif flag definition.
+ * @returns A new flag definition annotated for non-interactive validation and help output.
+ */
+export declare function requiredIfNonInteractive<TFlag extends {
+    description?: string;
+}>(flag: TFlag): TFlag;
 /**
  * Clear the CLI cache, used to store some API responses and handle notifications status
  */

Base automatically changed from gonzalo/noninteractive-flags-apps to main August 4, 2026 09:35
@gonzaloriestra
gonzaloriestra added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit b598185 Aug 4, 2026
30 of 53 checks passed
@gonzaloriestra
gonzaloriestra deleted the gonzalo/noninteractive-flags-themes branch August 4, 2026 09:43
@gonzaloriestra gonzaloriestra added the #gsd:51036 CLI interactivity – Agentic optimizations label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:51036 CLI interactivity – Agentic optimizations no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants